<template>
  <div>
    <h1>hello vue</h1>
    <input type="text" v-model="bookname">
    <button @click="btn">点我 - 查询</button>
  </div>
</template>

<script>
import { getBooks, addBook } from "./api/books.js"
// 不能通过下面方法导入
// import obj from "./api/books.js"
export default {
  data(){
    return {
      bookname: ""
    }
  },
  methods: {
    btn(){
      getBooks({
        bookname: this.bookname
      }).then(res=>{
        console.log(res);
      })
    }
  }
}
</script>

<style>

</style>